<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="/pages/sysIndex/default.jsp"/>
<style>

    ul {
        padding-left: 0;
        overflow: hidden;
    }

    ul li {
        float: left;
        list-style: none;
        width: 44px;
        height: 44px;
        background: url(<c:url value="/resources/images/starBlack.png" />)
    }

    ul li a {
        display: block;
        width: 100%;
        padding-top: 100px;
        overflow: hidden;
    }

    ul li.light {
        background: url(<c:url value="/resources/images/staryellow.png" />)
    }

</style>
<div class="main-content">
    <div class="box box-main">
        <form id="assignDateForm" model="post" action="<c:url value="/web/admin/maintainOrder/editOrder.action"/>"
              enctype="multipart/form-data"
              method="post" class="form-horizontal">
            <div class="box-footer">
                <div class="col-xs-12">
                    <div class="form-group">
                        <label class="control-label col-sm-3" title=""><span class="required ">*</span>
                            工单编号：<i class="fa icon-question hide"></i></label>
                        <div class="col-sm-9">
                            <input name="orderCode" id="orderCode" disabled class="form-control"
                                   value="${maintainOrder.orderCode}">
                            <input type="hidden" name="type" id="type" value="${1}">

                            <input type="hidden" name="ids"  value="${ids}">
                        </div>
                    </div>
                </div>
                <div class="col-xs-12">
                    <div class="form-group">
                        <label class="control-label col-sm-3" title="">
                            <span class="required ">*</span> 评价：<i class="fa icon-question hide"></i></label>
                        <div class="col-sm-9">
                             <textarea name="remark" rows="4" maxlength="200"
                                       class="form-control"></textarea>
                        </div>
                    </div>
                </div>
                <div class="col-xs-12">
                    <div class="form-group">
                        <div class="form-group">
                            <label class="control-label col-sm-3" title="">
                                <span class="required ">*</span> 评分：<i class="fa icon-question hide"></i>
                            </label>
                            <input type="hidden" name="score" id="starNum" value="1">
                            <ul class="col-sm-9">
                                <li class="light star" style="background-size: 44px 44px"><a href="javascript:;">1</a></li>
                                <li style="background-size: 44px 44px"><a href="javascript:;">2</a></li>
                                <li style="background-size: 44px 44px"><a href="javascript:;">3</a></li>
                                <li style="background-size: 44px 44px"><a href="javascript:;">4</a></li>
                                <li style="background-size: 44px 44px"><a href="javascript:;">5</a></li>
                            </ul>
                        </div>
                    </div>

                </div>


                <div class="row">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i
                                class="fa fa-check"></i>
                            保 存
                        </button>&nbsp;

                        <button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="closeView()"><i
                                class="fa fa-times"></i> 关 闭
                        </button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>


<script>
    var num = finalnum = tempnum = 0;
    var lis = document.getElementsByTagName("li");
    //num:传入点亮星星的个数
    //finalnum:最终点亮星星的个数
    //tempnum:一个中间值
    function fnShow(num) {
        finalnum = num || tempnum;//如果传入的num为0，则finalnum取tempnum的值
        for (var i = 0; i < lis.length; i++) {
            lis[i].className = i < finalnum ? "light" : "";//点亮星星就是加class为light的样式
        }
    }

    for (var i = 1; i <= lis.length; i++) {
        lis[i - 1].index = i;
        lis[i - 1].onmouseover = function () { //鼠标经过点亮星星。
            fnShow(this.index);//传入的值为正，就是finalnum
            $("#starNum").val(this.index)
        }
        lis[i - 1].onmouseout = function () { //鼠标离开时星星变暗
            fnShow(0);//传入值为0，finalnum为tempnum,初始为0
        }
        lis[i - 1].onclick = function () { //鼠标点击,同时会调用onmouseout,改变tempnum值点亮星星
            tempnum = this.index;
        }
    }

    $("#assignDateForm").validate({
        submitHandler: function (form) {
            js.ajaxSubmitForm($(form), function (data) {
                js.showMessage(data.msg);
                if (data.status == Global.NO) {
                    closeView();
                    parent.$("#dataGrid").dataGrid("refresh");
                }
            }, "json");
        }
    });
    var date = new Date();
    // var endDate=Date.parse($("#end").val());
    $("#endDate").datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        startDate: date,
        endDate: $("#end").val(),
        language: 'zh-CN',
        // minView: 0,//设置只显示到分钟
        autoclose: true,//选中关闭
        todayBtn: true//今日按钮
    });


    function closeView() {
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    }


</script>


